import router from "./router";
import storage from "./utils/storage";



router.beforeEach((to,from,next)=>{
    let token = storage.getToken("token")
    if(token){
        if(to.path === '/login'){
            next(from.path)
        }else{
            next()
        }
    }else{
        if(to.path === '/login'){
            next()
        }else{
            next('/login')
        }
    }
})